// https://blog.csdn.net/aexwx/article/details/136386500
// https://www.cnblogs.com/lanse1993/p/17794528.html

const ffmpeg = require('fluent-ffmpeg')
const ffmpegPath = require('@ffmpeg-installer/ffmpeg')
const ffprobePath = require('@ffprobe-installer/ffprobe')
const path = require('path')

// 定义视频文件路径
ffmpeg.setFfmpegPath(ffmpegPath.path)
ffmpeg.setFfprobePath(ffprobePath.path)

ffmpeg.ffprobe(path.join(__dirname, './video/01_(掌握)Hooks-修改标题案例-useEffect的.mp4'), (error, data) => {
  if (error) {
    console.log(error)
  } else {
    console.log(data.format.size)
    console.log(data.format.duration)
  }
})